package com.joinway.framework.bean.constant;

import org.jsondoc.core.annotation.ApiObject;
import org.jsondoc.core.annotation.ApiObjectField;

@ApiObject(name = "ErrorCodeConstants", description = "通用错误码", show=false)
public final class ErrorCodeConstants {

	public static final String INTERNAL_ERROR_DESC = "内部错误";
	@ApiObjectField(description = "1000-" + INTERNAL_ERROR_DESC)
	public static final String INTERNAL_ERROR = "1000";
	
	/**
	 * 1001-1050 验证失败错误码
	 */
	public static final String INVALID_DESC = "验证失败";
	@ApiObjectField(description = "1001-" + INVALID_DESC)
	public static final String INVALID = "1001";
	
	public static final String INVALID_REQUEST_HEADER_DESC = "无效的request header";
	@ApiObjectField(description = "1002-" + INVALID_REQUEST_HEADER_DESC)
	public static final String INVALID_REQUEST_HEADER = "1002";
	
	public static final String SESSION_EXPIRED_DESC = "session超时";
	@ApiObjectField(description = "1003-" + SESSION_EXPIRED_DESC)
	public static final String SESSION_EXPIRED = "1003";
	
	public static final String INVALID_TOKEN_DESC = "无效的单点登录token";
	@ApiObjectField(description = "1004-" + INVALID_TOKEN_DESC)
	public static final String INVALID_TOKEN = "1004";
	
	public static final String INVALID_SECURITY_TOKEN_DESC = "无效的验证token";
	@ApiObjectField(description = "1005-" + INVALID_SECURITY_TOKEN_DESC)
	public static final String INVALID_SECURITY_TOKEN = "1005";	// reserved for random token usage
	
	public static final String INVALID_SQL_TEXT_DESC = "包含有SQL注入威胁的字符";
	@ApiObjectField(description = "1006-" + INVALID_SQL_TEXT_DESC)
	public static final String INVALID_SQL_TEXT = "1006";
	
	public static final String INVALID_INPUT_DESC = "输入格式错误";
	@ApiObjectField(description = "1007-" + INVALID_INPUT_DESC)
	public static final String INVALID_INPUT = "1007";

	public static final String INVALID_DATA_DESC = "数据格式错误";
	@ApiObjectField(description = "1008-" + INVALID_DATA_DESC)
	public static final String INVALID_DATA = "1008";

	public static final String INVALID_FILE_DESC = "文件类型不匹配";
	@ApiObjectField(description = "1009-" + INVALID_FILE_DESC)
	public static final String INVALID_FILE = "1009";

	public static final String REQUEST_TIMEOUT_DESC = "请求超时";
	@ApiObjectField(description = "1010-" + SESSION_EXPIRED_DESC)
	public static final String REQUEST_TIMEOUT = "1010";

	/**
	 * 1051-1100通用处理错误码
	 */
	public static final String DUPLICATE_DATA_DESC = "数据重复";
	@ApiObjectField(description = "1051-" + DUPLICATE_DATA_DESC)
	public static final String DUPLICATE_DATA = "1051";
	
	public static final String SAVE_FAILURE_DESC = "保存失败";
	@ApiObjectField(description = "1052-" + DUPLICATE_DATA_DESC)
	public static final String SAVE_FAILURE = "1052";

	private ErrorCodeConstants(){}
}
